<?php
class Zend_View_Helper_TopMenu
{
	public function topMenu($view)
	{
		$strList ="";$selectGroup="";$selectUser="";$selectComment="";$selectLog="";$selectforum="";$selectquest="";$selectnews="";
		switch ($view->controllerName)
		{
			case 'user':
				$selectUser = 'current';
				break;
			case 'group':
				$selectGroup = 'current';
				break;						
			case 'comment':
				$selectComment = 'current';
				break;
			case 'log':
				$selectLog = 'current';
				break;
			case 'forum':
				$selectforum = 'current';
				break;
			case 'typenews':
				$selectforum = 'current';
				break;
			case 'quest':
				$selectquest = 'current';
				break;
			case 'news':
				$selectnews = 'current';
				break;
		}
		
		$strList .= "<div  class='topmenu' >
						<ul  id='topnav'>";
			if(Utility::checkPrivilege($view, "user", "index"))
				$strList .= "<li class='$selectUser'><a href='$view->baseUrl/admin/user/index'>Người dùng</a></li>";	
			
			if(Utility::checkPrivilege($view, "group", "index"))
				$strList .= "<li class='$selectGroup'><a href='$view->baseUrl/admin/group/index'>Nhóm</a></li>";
			
			if(Utility::checkPrivilege($view, "forum", "index"))
				$strList .= "<li class='$selectforum'><a href='$view->baseUrl/admin/forum/index'>Chuyên mục</a></li>";
		
			if(Utility::checkPrivilege($view, "news", "index"))
				$strList .= "<li class='$selectnews'><a href='$view->baseUrl/admin/news/index'>Tin tức</a></li>";
			
			if(Utility::checkPrivilege($view, "comment", "index"))
				$strList .= "<li class='$selectComment'><a href='$view->baseUrl/admin/comment/index'>Bình luận</a></li>";
        	
			if(Utility::checkPrivilege($view, "quest", "index"))
				$strList .= "<li class='$selectquest'><a href='$view->baseUrl/admin/quest/index'>Khảo sát</a></li>";
			
			if(Utility::checkPrivilege($view, "log", "index"))
				$strList .= "<li class='$selectLog'><a href='$view->baseUrl/admin/log/index'>Lược sử</a></li>";
			
      
		$strList .=		"</ul>
					</div>";

		echo $strList;
	}
}
?>
 
